package model.dto.user;

import java.util.Date;

/**
 * 
 * Description: 用户User的简化实体类，用于输出XML的DTO，权限级别属性简化为只含有ID和name的对象<br/>
 * 其中也不含有密码属性
 * 
 * @since  2009/2/23
 * @author ashen
 * 
 */
public class User {
	private Integer id;
	private String name;
	private String nickName;
	private String profile;
	private Date createDate;
	private model.dto.user.Role role;//权限级别
	
	public User() {
		super();
		// TODO Auto-generated constructor stub
	}
	public User(model.User user) {
		this.id = user.getId();
		this.name = user.getName();
		this.nickName = user.getNickName();
		this.profile = user.getProfile();
		this.createDate = user.getCreateDate();
		this.setRole(user.getRole());
	}
	public User(Integer id, String name, String nickName,
			String profile, Date createDate, model.dto.user.Role role) {
		super();
		this.id = id;
		this.name = name;
		this.nickName = nickName;
		this.profile = profile;
		this.createDate = createDate;
		this.role = role;
	}
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getNickName() {
		return nickName;
	}
	public void setNickName(String nickName) {
		this.nickName = nickName;
	}
	public String getProfile() {
		return profile;
	}
	public void setProfile(String profile) {
		this.profile = profile;
	}
	public Date getCreateDate() {
		return createDate;
	}
	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
	public model.dto.user.Role getRole() {
		return role;
	}
	public void setRole(model.Role role) {
		this.role = new model.dto.user.Role(role);
	}
	
}
